﻿/*
 * ©2009-2010 XELF
 * http://xelf.info
 */

namespace XELF.Framework {

	public partial struct Quaternion {
		/// <summary>
		/// 逆クォータニオン
		/// </summary>
		public static void Invert(ref Quaternion value, out Quaternion result) {
			var r = MathHelper.Rcp(value.LengthSquared());
			result = new Quaternion(-value.X * r, -value.Y * r, -value.Z * r, value.W * r);
		}
		/// <summary>
		/// 逆クォータニオン
		/// </summary>
		public static Quaternion Invert(Quaternion value) {
			Quaternion result;
			Invert(ref value, out result);
			return result;
		}
	}

}
